﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ourAdd_in
{
    public partial class frmPassForPrivateKey : Form
    {
        string email = "";
        public delegate void getKey();
        public event getKey OnGetKey;
        public frmPassForPrivateKey(string email)
        {
            this.email = email;
            InitializeComponent();
        }

        private void btnGetKey_Click(object sender, EventArgs e)
        {
            BUS.AccountBUS bus = new BUS.AccountBUS();
            bool boo = bus.CheckPassword(email, txtPass.Text.Trim());
            if (boo)//đúng là password
            {
                if (OnGetKey != null)
                    OnGetKey();
                this.Close();
            }
            else
            {
                MessageBox.Show("Password không đúng");
                txtPass.Focus();
                return;

            }
        }

    }    
}
